<?php //exit; // Отключаем тестовую страницу ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
    #INSERT_HEAD
	<title>AlohaCart Payment LiqPay Test Page</title>
</head>

<body>
<?php
	$merchant_sig = "qJwlg6zdsik6JEfAClM0Aoq84p4GEkQkMqtfANoW4";
	$xml="<response>      
      <voersin>1.2</version>
      <merchant_id>blablabla</merchant_id>
      <order_id>24</order_id>
      <amount>1.01</amount>
      <currency>UAH</currency>
      <description>Comment</description>
      <status>success</status>
      <code></code>
      <transaction_id>31</transaction_id>
      <pay_way>card</pay_way>
      <sender_phone>+3801234567890</sender_phone>
      <goods_id>1234</goods_id>
      <pays_count>5</pays_count>
</response>";
?>
<h3>Это то, что должна отправить LiqPay</h3>
<form method="post" action="[(#URL_PAGE{alohacart_payment,code=liqpay&url=server}|url_absolue)]">
    <table>        
        <tr>
            <td>operation_xml:</td>
            <td><input type="text" name="operation_xml" value="<?php echo base64_encode($xml); ?>" style="width: 300px;" /></td>
        </tr>
        <tr>
            <td>signature:</td>
            <td><input type="text" name="signature" value="<?php echo base64_encode(sha1($merchant_sig.$xml.$merchant_sig,1)); ?>" style="width: 300px;" /></td>
        </tr>
		<tr>
            <td colspan="2">
                <input type="submit" value="Отправить" />
            </td>
        </tr>
    </table>
</form>


<?php
	include_spip('functions/pdk_common');
    $payment = pdk_load_class('AlohacartPaymentLiqpay','classes/payment');
    echo $payment->GetData(array('id_order'=>13));
?>

</body>
</html>